
class Animal {
    protected String name;
    protected int age;

    static {
        System.out.println("Animal::static{静态}");
    }

    {
        System.out.println("Animal::{实例}");
    }

    public Animal(String name,int age){
        this.name = name;
        this.age = age;
        System.out.println("Animal(String name,int age)");
    }
    public void eat(){
        System.out.println(name+" 正在吃饭");
    }
}

class Dog extends Animal {
    public Dog(String name,int age){
        super(name,age);
        System.out.println("Dog(String name,int age)");
    }

    static {
        System.out.println("Dog::static{静态}");
    }

    {
        System.out.println("Dog::{实例}");
    }

    public void brak(){
        System.out.println(name+" 汪汪汪");
    }
}

class Cat extends Animal {
    public Cat(String name,int age){
        super(name,age);
        System.out.println("Cat(String name,int age)");
    }
    public void mimi(){
        System.out.println(name+" 喵喵喵");
    }
    static {
        System.out.println("Cat::static{静态}");
    }

    {
        System.out.println("Cat::{实例}");
    }
}

public class Test {
    public static void main(String[] args) {
        Dog dog = new Dog("ahuang",10);
        Cat cat = new Cat("mimi",13);
    }
}






















